package ruifeng.zcj.happymahjony.activity.base;

import android.app.Activity;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Toast;

import ruifeng.zcj.happymahjony.manager.ActivityManager;

/**
 * 基层窗口<br/>
 */
public class BaseActivity extends Activity {

    /**
     * 全屏<br/>
     */
    public void setFullScreen() {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }

    /**
     * Toast提示<br/>
     */
    public void showToast(String text) {
        Toast.makeText(this, text, Toast.LENGTH_SHORT).show();
    }

    /**
     * Toast提示<br/>
     */
    public void showLongToast(String text) {
        Toast.makeText(this, text, Toast.LENGTH_LONG).show();
    }

    public void finish() {
        super.finish();
        ActivityManager.getInstance().removeActivity(this);
    }
}
